<?php
/**
 * $Id: config.inc.php 27 2009-06-27 02:26:17Z eyou80 $
 */

define('__TINYASK_ROOT_DIR__', dirname(__FILE__));

define('__TINYASK_PLUGIN_DIR__', '/usr/plugins');

define('__TINYASK_THEME_DIR__', '/usr/themes');

define('__TINYASK_ADMIN_DIR__', '/admin');

@set_include_path(get_include_path() . PATH_SEPARATOR .
__TINYASK_ROOT_DIR__ . '/var' . PATH_SEPARATOR .
__TINYASK_ROOT_DIR__ . __TINYASK_PLUGIN_DIR__);

require_once 'tinyask/common.php';

/** 运行环境初始化 **/
Tinyask_Common::init(array(
	'autoload' => true,
	'exception' => 'App_ExceptionHandle',
	'timezone' => 'UTC',
	'gzip' => true,
	'charset' => 'UTF-8',
	'contentType' => 'text/html'
));

/** 实例化数据库 **/
$db = new Tinyask_Db('Mysql', array(
	'host' => 'localhost',
	'user' => 'root',
	'password' => '123456',
	'charset' => 'utf8',
	'port' => '3306',
	'database' => 'test',
), 'tinyask_');
Tinyask_Db::set($db);

/** 网站配置 **/
Tinyask_App::app('App_Config')->to($config);

/** 定义路由参数 **/
Tinyask_Router::setRoutes($config->routingTable);

/** 初始化插件 **/
Tinyask_Plugin::init($config->plugins);

/** 时区设置 **/
Tinyask_Date::setTimezone($config->timezone);
